<?php

use App\Clinic\Services\ClinicService;
use App\Clinic\Services\DepartmentService;
use App\User\Http\Controllers\AuthNameController;
use App\User\Http\Controllers\UserController;
use App\User\Services\AuthNameService;
use App\User\Services\UserService;
use Illuminate\Support\Facades\Route;

// 公共部分
Route::prefix('common')->group(function() {
    // 获取轮播图列表
    Route::get('banner/get_list', [\App\Common\Services\BannerService::class, 'getListRpc']);
});

// 诊所内部通讯接口
Route::prefix('clinic')->group(function (){
    Route::get('index', [ClinicService::class, 'getRpcList']); // 获取诊所列表
    Route::get('index/ids', [ClinicService::class, 'getRpcListByIds']); // 通过id组获取诊所列表
    Route::get('info/{id}', [ClinicService::class, 'getInfo']); // 获取诊所详情

    Route::get('department', [DepartmentService::class, 'getListByIds']); // 获取科室列表
    Route::get('department/list', [DepartmentService::class, 'getRpcList']); // 获取科室列表
    Route::get('department/info/{id}', [DepartmentService::class, 'getInfo']); // 获取诊室详情
});

// 患者相关内部通讯接口
Route::prefix('user')->group(function () {
    // 用户手机号登录
    Route::post('login/phone', [\App\User\Services\UserService::class, 'loginByPhone']);
    // 更换用户手机号
    Route::post('update/phone', [\App\User\Services\UserService::class, 'updatePhone']);
    // 用户实名认证信息接口
    Route::get('info', [UserService::class, 'getInfo']); // 获取用户实名认证详情
    Route::post('update/auth', [UserService::class, 'updateAuth']); // 更新用户实名认证信息
    Route::post('auth/create', [AuthNameService::class, 'create']); // 添加用户实名验证

    //im 用户绑定
    Route::get('im/user_auth', [\App\User\Services\UserService::class, 'userAuth']); //  查看im 用户绑定状态
    Route::post('im/useradd', [\App\User\Services\UserService::class, 'userAuthAdd']); //  查看im 关系添加

});

// 医生相关内部通讯接口
Route::prefix('doctor')->group(function () {
    // 医生手机号登录
    Route::post('login/phone', [\App\Doctor\Services\DoctorService::class, 'loginByPhone']);

    // 根据ID获取医生列表
    Route::get('list', [\App\Doctor\Services\DoctorService::class, 'getListByIds']);

    // 获取医生列表
    Route::get('list_all', [\App\Doctor\Services\DoctorService::class, 'getListRpc']);

    // 获取医生信息
    Route::get('info/{id}', [\App\Doctor\Services\DoctorService::class, 'getInfoById']);

    //im 用户绑定
    Route::get('im/doctor_auth', [\App\Doctor\Services\DoctorService::class, 'doctorAuth']); //  查看im 用户绑定状态
    Route::post('im/doctor_auth_add', [\App\Doctor\Services\DoctorService::class, 'doctorAuthAdd']); //  查看im 关系添加
});


// 商品查看
Route::prefix('goods')->group(function () {
    Route::get('attr_list', [\App\Goods\Services\GoodsAttrService::class, 'attrList']);
});

